package com.easyaop.test.core.around;

import java.lang.reflect.Field;

public class Bean2 {
    private int name;

    public Object a(String args) throws Throwable {
        System.out.println("before");
        Object around = BeanAround_a.around(this, args);
        System.out.println("after");
        return around;
    }

    private static class BeanAround_a {
        private static Field field_name;

        static {
            try {
                field_name = Bean2.class.getDeclaredField("a");
                field_name.setAccessible(true);
            } catch (NoSuchFieldException e) {
                throw new RuntimeException(e);
            }
        }

        static Object around(Bean2 the, Object args) {
            System.out.println("a");
            System.out.println(the.name);
            System.out.println(args);

            return args + "1";
        }
    }
}
